import fs from 'fs';
import path from 'path';
import yaml from 'js-yaml';

export interface ConnectionConfig {
  token?: string;
  ws: {
    server: {
      enable: boolean;
      port: number;
    };
    client: {
      enable: boolean;
      host: string;
    };
  };
}

export function loadConnectionConfig(): ConnectionConfig {
  const configPath = path.join(__dirname, '../config/connection.yml');
  const fileContents = fs.readFileSync(configPath, 'utf8');
  return yaml.load(fileContents) as ConnectionConfig;
}